home *** CD-ROM | disk | FTP | other *** search
/ 10,000 Great Games / 10,000 Great Games.iso / Product / 66 / data1.cab / Source_Files / Src / Pushable.cpp < prev    next >
C/C++ Source or Header  |  2000-01-16  |  500b  |  27 lines

  1. #include "stdafx.h"
  2.  
  3. cPushable::cPushable(int _x, int _y, cProperties *_orig)
  4.         : cWeapon(_x, _y, _orig, "MOVING")
  5. }
  6.  
  7. cPushable::~cPushable()
  8. {
  9. }
  10.  
  11. int cPushable::control()
  12.     cWeapon::control();
  13.     
  14.     bounce_on_boundaries();
  15.     
  16.     // Kill object when we hit something or go off screen
  17.     
  18.     return !((abs(vx) > (fix)5 || !resting) && check_radial_hit_one(circle_bounds)) && !in_water();
  19. }
  20.  
  21. void cPushable::hit(fix dir, cWeapon *w)
  22. {
  23.     add_angular_speed(5 * w->push_power, dir);
  24. }
  25.